package com.tedu.egmvc.result;


import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class JsonResult {
    private Integer statusCode;
    private String message;
    private Object data;

    public JsonResult(Status status)
    {
        this.statusCode = status.getStatusCode();
        this.message = status.getMessage();
    }
    public JsonResult(Status status, Object Object)
    {
       this(status);
       this.data = Object;
    }
    public static JsonResult success()
    {
        return new JsonResult(Status.OPERATION_SUCCESS);
    }
    public static JsonResult success(Object data)
    {
        return new JsonResult(Status.OPERATION_SUCCESS,data);
    }
}
